//! Copyright 2011 Xicut Technology, Inc.
//! All rights reserved
//!
#ifndef __SIM900AppCommand_h__
#define __SIM900AppCommand_h__

#include "BasicTypes.h"
#include "Handles.h"
#include "SmsCmdDesc.h"
#include "FIFO.h"

class cSIM900AppCommand
{
public:
    //! Performs reset initialization
    //!
    static void Init_Reset();

    //! Allocates a Data Collector command
    //! Allocation is meant to be performed once during system initialization stage
    //!
    //!
    //! \return DataCollectorCommandHandle
    static SIM900AppCommandHandle Alloc();

    //! Retrieves pointer from handle
    //!
    //! \param iDataCollectorCommandHandle   [in]  The handle of cDataCollectorCommand
    //!
    //! \return cDataCollectorCommand*
    static cSIM900AppCommand* GetPointer( SIM900AppCommandHandle iSIM900AppCommandHandle );

    //! Retrieves associated handle
    //!
    //! \return DataCollectorCommandHandle
    SIM900AppCommandHandle GetHandle();

public:
    cSmsCmdDesc::sSmsMsg m_Data;
    static cFIFO         s_SendFIFO;
    static U32           s_SendFIFO_Storage[];
    static cFIFO         s_SendStatusFIFO;
    static U32           s_SendStatusFIFO_Storage[];
    static cFIFO         s_ReceiveFIFO;
    static U32           s_ReceiveFIFO_Storage[];
    static cFIFO         s_ReceiveStatusFIFO;
    static U32           s_ReceiveStatusFIFO_Storage[];

private:
    static cSIM900AppCommand    s_AllocationPool[];
    static U32                  s_CurAllocIndex;
};

#endif  // __SIM900AppCommand_h__
